using System;
using System.Collections.Generic;
using System.Text;

namespace SqlTools.CodeGenerator.Data
{
	public class MethodCollection : List<Method>
	{
		public Method this[string name]
		{
			get
			{
				foreach ( Method method in this )
				{
					if ( method.MethodName == name )
						return method;
				}

				return null;
			}
		}

		public Method[] GetMethodsByType(MethodType type)
		{
			List<Method> methods = new List<Method>();

			foreach ( Method method in this )
			{
				if ( method.Type == type )
					methods.Add(method);
			}

			return methods.ToArray();
		}
	}
}
